<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
	</head>
	<body>

	</body>
	<script>
		// 转化成字符串
		// var num = prompt("请输入一个数字");
		// console.log(num);
		var num1 = 13;
		console.log(num1);
		console.log(typeof num1);
		// var a = num1.toString();
		// var a = String(num1);
		var a = num1 + "岁";
		// 隐式转换
		// 转化成数字型
		console.log(a);
		console.log(typeof a);
		var num2 = '678.1';
		console.log(num2);
		console.log(Number(num2));
		console.log(parseInt(num2));
		console.log(parseFloat(num2));
		var num3 = '123' - 0;
		console.log(num3);
		
		// var one = prompt('1');
		// var two = prompt('2');
		// var zhuanhuan1 = Number(one);
		// var zhuanhuan2 = Number(two);
		// var he = zhuanhuan1 + zhuanhuan2;
		// console.log(he);
		// alert(he);
		// alert(Number(one) +  Number(two));
		// var age = prompt('请输入出生日期');
		// alert('你今年'+ (2022 - Number(age)) + '岁了');
		console.log(Boolean(123));
		console.log(Boolean(!!'卢辉'));
		// !   把指定的值转换为布尔类型然后取反
		// !!  取反再取反
	</script>
</html>
